home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
maximus
/
stbar20.zip
/
STARBAR.MH
< prev
next >
Wrap
Text File
|
1996-04-12
|
14KB
|
362 lines
////////////////////////////////////////////////////////////////////////////
//
// StarBar V2.00 Include File (!)1996 Larry Monte / StarLab Systems SoftWare
//
////////////////////////////////////////////////////////////////////////////
///////////////////////Terminology Explanations/////////////////////////////
//
// About un-commenting/commenting-out:
// -----------------------------------
//
// When talking about commenting-out, it refers to disabling one of the
// #defines below.
// To comment out a #define, simply place "//" (without quotes) before
// the #define.
// To un-comment, remove the "//"'s (without quotes) which appear before
// the #define.
//
////////////////////////////////////////////////////////////////////////////
////////////-=The Following Defines !MUST! Be Changed By YOU!=-/////////////
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
////////////////////////////////////////////////////////////////////////////
// Define your StarBar path...I suggest making a separate directory rather
// than having the main StarBar files in your /max/m directory. Be sure to
// use double \\'s in your path, and don't forget to include the trailing
// \\'s
#define STARBAR_PATH "C:\\max\\starbar\\"
////////////////////////////////////////////////////////////////////////////
// One of the following 2 defines must be uncommented. It determines the
// type of operating system you are using. WIN95 users should define DOS..
// Default is DOS
#define DOS
// #define OS2
////////////////////////////////////////////////////////////////////////////
// The ACCESS define sets the minimum access required for users to use the
// TAG/DL functions of StarBar. With this, you can have Transient users
// browse with StarBar, but they would be unable to TAG or DL until their
// access is raised to equal or above what is defined here.
// You can use any of: > < <> >= <= = in this define, but is best left at
// >=
//
// EG: ">= Normal "
// ^
// NOTE: Be sure to include the trailing space within the quotes!
//
#define ACCESS ">= Limited "
////////////////////////////////////////////////////////////////////////////
// The KEY define works with STTOG. With STTOG in your file menu, users
// can select if they want to use STARBAR or the canned file listing.
// This can be set to any valid access key used by Maximus. Be sure
// to select a key not being used by anything else and that it's the same
// key defined in STTOG.
#define KEY "O"
////////////////////////////////////////////////////////////////////////////
// The DO_LOCAL_DL keyword allows SysOps to use the DL command to copy files
// to a specified dir. If you don't need (or want) this ability, comment
// this define out.
#define DO_LOCAL_DL
////////////////////////////////////////////////////////////////////////////
#ifdef DO_LOCAL_DL // <<--DON'T TOUCH THIS LINE!!!!!
////////////////////////////////////////////////////////////////////////////
// Define a default path you wish to put your files using the DL command.
// Note that you are also prompted to override this path at time of DL
// Be sure to use double "\\"'s and include the trailing "\\"'s
#define LOCAL_DL_PATH "C:\\atemp\\"
////////////////////////////////////////////////////////////////////////////
#endif // <<--DON'T TOUCH THIS LINE EITHER!!!!!
////////////////////////////////////////////////////////////////////////////
/////////////////////////-=Optional Changes=-///////////////////////////////
//
// This section includes optional changes. If this is the first time setting
// up StarBar, you should quit here, and worry about these changes later.
//
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// If the following define is commented out, StarBar will only highlight the
// filename. If left uncommented, StarBar will highlight all the file info
// (filename, size, date)
#define HILIGHT_ALL
////////////////////////////////////////////////////////////////////////////
// The DO_VIEW define tells Starbar if you intend to use external files
// for the V)iew functions of Starbar. With this, users can inspect DIZ,
// TXT, DOC, PRN, and any instance of READ.ME files....before they DL them!
// If this define is commented out, StarBar will expand the entire FILES.BBS
// description, and all external file inspection will be disabled.
#define DO_VIEW
////////////////////////////////////////////////////////////////////////////
// Define how many characters you would like to use in your DL counter.
// I suggest using _at least_ 2 places ("[ 9]") so that the DL counter is
// good up to 99. If you have a file that has been DL'ed more than 99
// times then three spaces is a good idea. I use 4 places here ("[ 9]")
// giving me upward compatability up to 9999 DL's on any given file.
// If you don't want to use a DL counter, define zero.
#define COUNT_OFFSET 4
////////////////////////////////////////////////////////////////////////////
// MAX_LINES, as set below will set the screen length display according to
// what the user's screen length is. However, if you find you get a lot
// of complaints about the lightbar screwing up (usually Windows users)
// you can set this to 24 (a happy medium for most people) to use a set
// display length
#define MAX_LINES usr.len
////////////////////////////////////////////////////////////////////////////
// I recommend leaving this alone until you are certain StarBar is working
// correctly. It basically logs some info that might be useful in tracking
// some setup problems. Some basic activity is also logged.
#define DO_LOG
////////////////////////////////////////////////////////////////////////////
// The following 2 defines determine what kind of brackets are to be used
// for your DL counter. [,{,(,<, are all acceptable.
// Note: If you defined COUNT_OFFSET to zero above, these defines mean
// nothing...
#define ST_COUNT_LBRACKET "["
#define ST_COUNT_RBRACKET "] " //<-- include a trailing space with this
// one
////////////////////////////////////////////////////////////////////////////
// The following 4 KEY_* defines do 2 things. 1)Determines the hotkeys to
// be used.
// 2)Prints the Keys in the
// command line.
// Which is to say, if you changed "Xx" to "Qq", then "Q" would be used
// to exit StarBar, and the change would be noted in the command line.
// Be sure not to duplicate any of the KEY_* defines. (There are more
// further down in this file, which can't be changed)
// Also, be sure to include _BOTH_ uppercase and lowercase as shown below.
//
// NOTE: Be sure to edit SBHELP#.MEC to reflect any changes you make here!
#define KEY_DL_TAG "Dd" // For DLing Tagged Files Only
#define KEY_VIEW "Vv" // For the V)iew Long Descriptions option
#define KEY_LIST "Ll" // For List/Editing Tagged files
#define KEY_EXIT "Xx" // For Exiting StarBar
////////////////////////////////////////////////////////////////////////////
// The following 3 HI_* defines determine the colour of the highlighted
// file information. See COLOURS.TXT for a list of valid colour codes.
#define HI_FILENAME "\x16\x01\x70"
#define HI_FILESIZE "\x16\x01\x71"
#define HI_FILEDATE "\x16\x01\x78"
////////////////////////////////////////////////////////////////////////////
// The following 3 LO_* defines determine the colour of the lowlighted
// file information. Again, see COLOURS.TXT for a list of colour codes.
#define LO_FILENAME "\x16\x01\x0e"
#define LO_FILESIZE "\x16\x01\x05"
#define LO_FILEDATE "\x16\x01\x02"
////////////////////////////////////////////////////////////////////////////
// The ST_COL_DESC define determines the colour of the file description.
#define ST_COL_DESC "\x16\x01\x03"
////////////////////////////////////////////////////////////////////////////
// The ST_TAG define determines the colour of the "File Tagged" indicator,
// as well as the character to show the file is tagged:
//
// "\x16\x01\x0e+"
// \__________/^
// Yellow |
// ----> Char "+" is the tag indicator
#define ST_TAG "\x16\x01\x0e+"
////////////////////////////////////////////////////////////////////////////
// The next 2 defines determine the colour of the command line brackets,
// as well as the brackets themselves, and the colour the command will
// appear in
//
// ST_LBRACKET ST_RBRACKET
//
// "\x16\x01\x0f[\x16\x01\x0a" "\x16\x01\x0f]"
// \__________/^\__________/ \__________/^
// White | Green - Command Colour White |
//Bracket Colour| ---> Right
// ----> Left bracket to use bracket
//
#define ST_LBRACKET "\x16\x01\x0f[\x16\x01\x0a"
#define ST_RBRACKET "\x16\x01\x0f]"
/////////////////////////Your DONE Stop Here!!!/////////////////////////////
// The rest of the KEY_* defines are for the command line display only. They
// are not hotkeys shouldn't be change.
#define KEY_HELP "?" // For Help
#define KEY_DOWN "2" // For Down
#define KEY_UP "8" // For Up
#define KEY_PGDN "3" // For PageDown
#define KEY_PGUP "9" // For PageUp
#define KEY_TAG str_st_com_space // For Space Bar Tagging
#define KEY_DL_CURR str_st_com_enter // For DLing current file
#define ST_COL_INVISIBLE "\x16\x01\x10\x80" // For hiding cursor
#define DESCRIPT 47 // Max description line
#define FF_OFFLINE 0x02 // Flag for file offline
#define this_task uitostr(id.task_num) // Task number
string longpadleft(long: i, int: len, int: ch)
{
string: itos;
string: rc;
itos:=ltostr(i);
rc:=strpad("", len - strlen(itos), ch);
return rc + itos;
}
void bit_date_to_stamp(unsigned long: bit_date, ref struct _stamp: udate)
{
udate.time.hh := (bit_date & 0xf8000000) shr 27;
udate.time.mm := (bit_date & 0x07e00000) shr 21;
udate.time.ss := (bit_date & 0x001f0000) shr 15;
udate.date.year := (bit_date & 0xfe00) shr 9;
udate.date.month := (bit_date & 0x01e0) shr 5;
udate.date.day := (bit_date & 0x001f);
}
unsigned long hextoul(string: str_p, int: offset)
{
unsigned long : wide_long;
wide_long := (unsigned char)str_p[offset+3];
wide_long := (wide_long shl 8) + (unsigned char)str_p[offset+2];
wide_long := (wide_long shl 8) + (unsigned char)str_p[offset+1];
return (wide_long shl 8) + (unsigned char)str_p[offset];
}
unsigned int hextoui(string: str_p, int: offset)
{
unsigned int: wide_int;
wide_int := (unsigned char)str_p[offset+1];
return (wide_int shl 8) + (unsigned char)str_p[offset];
}
// The following was taken from XGETCH.MH originally my Matt Scott but
// later modified by Don Reid....Stripped it down a bit for use with
// StarBar...Removed comments to save space.
#define X_INVALID 255
#define X_EMPTY 0
#define XGETCH_ANSI_TRIES 500
int ___XGETCH_ANSI_WAIT_LOOP_FAIL()
{
int: tries;
for (tries:=0;
(tries < XGETCH_ANSI_TRIES) AND (kbhit() = FALSE);
tries := tries+1)
{
;
}
tries := (kbhit() = FALSE);
return tries;
}
char: _xgetchinput;
char xgetch()
{
char: tempch;
int : pos;
string: results;
if (_xgetchinput <> X_EMPTY) {
tempch := _xgetchinput;
_xgetchinput := X_EMPTY;
return tempch;
}
tempch := getch();
if (tempch = 0) {
_xgetchinput := getch();
return tempch;
}
if (tempch = 27) {
if (___XGETCH_ANSI_WAIT_LOOP_FAIL())
{
return 27;
}
tempch := getch();
if (tempch <> '[') {
_xgetchinput := tempch;
return 27;
}
if (___XGETCH_ANSI_WAIT_LOOP_FAIL())
{
_xgetchinput := '[';
return 27;
}
tempch := getch();
pos := stridx( "\x48\x4b\x41\x42\x44\x43",1,tempch);
if (pos <> 0)
{
results := "\x47\x4f\x48\x50\x4b\x4d";
_xgetchinput := results[pos];
return 0;
}
if (tempch = 'O') {
if (___XGETCH_ANSI_WAIT_LOOP_FAIL()) {
_xgetchinput := X_INVALID;
return 0;
}
tempch := getch();
pos := stridx( "\x72\x71\x6e",1,tempch);
if (pos <> 0)
{
results := "\x47\x4f\x48";
_xgetchinput := results[pos];
return 0;
}
}
_xgetchinput := X_INVALID;
return 0;
}
return tempch;
}